In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
In [10]:
images=np.load("predict_image_epoch500_ns.npy")
recoloss=np.load("recon_loss_epoch500_ns.npy")
trajectory=np.load("trajectory_epoch500_ns.npy")
world=np.load("world1.npy")
In [20]:
len(trajectory.T)
Out[20]:
24886
In [18]:
plt.plot(recoloss)
Out[18]:
[<matplotlib.lines.Line2D at 0x113dc0cd0>]

0~100

In [7]:
start=0
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
    plt.subplot(hoge+1,hoge+1 , i+1)
    fig = plt.imshow(images[:,:,start+i])
    plt.axis('off')
In [11]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,0:100]-14,trajectory[1,0:100]-14,color='g')
plt.axis('off')
plt.show()

4000~4100

In [12]:
start=4000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
    plt.subplot(hoge+1,hoge+1 , i+1)
    fig = plt.imshow(images[:,:,start+i])
    plt.axis('off')
In [13]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,4000:4100]-14,trajectory[1,4000:4100]-14,color='g')
plt.axis('off')
plt.show()

8000~8100

In [14]:
start=8000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
    plt.subplot(hoge+1,hoge+1 , i+1)
    fig = plt.imshow(images[:,:,start+i])
    plt.axis('off')
In [15]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,8000:8100]-14,trajectory[1,8000:8100]-14,color='g')
plt.axis('off')
plt.show()

12000~12100

In [16]:
start=12000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
    plt.subplot(hoge+1,hoge+1 , i+1)
    fig = plt.imshow(images[:,:,start+i])
    plt.axis('off')
In [17]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,12000:12100]-14,trajectory[1,12000:12100]-14,color='g')
plt.axis('off')
plt.show()

16000~16100

In [21]:
start=16000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
    plt.subplot(hoge+1,hoge+1 , i+1)
    fig = plt.imshow(images[:,:,start+i])
    plt.axis('off')
In [23]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,16000:16100]-14,trajectory[1,16000:16100]-14,color='g')
plt.axis('off')
plt.show()

20000~20100

In [24]:
start=20000
goal=start+100
hoge= np.sqrt(len(images[0,0,start:goal]))
plt.figure(figsize=(15, 15), dpi=800)
for i in xrange(len(images[0,0,start:goal])):
    plt.subplot(hoge+1,hoge+1 , i+1)
    fig = plt.imshow(images[:,:,start+i])
    plt.axis('off')
In [25]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,16000:16100]-14,trajectory[1,16000:16100]-14,color='g')
plt.axis('off')
plt.show()
In [78]:
plt.imshow(world)
Out[78]:
<matplotlib.image.AxesImage at 0x13adc6fd0>
In [89]:
plt.figure()
plt.imshow(world,"gray")
plt.scatter(trajectory[0,:i]-14,trajectory[1,:i]-14,color='g')
plt.axis('off')
plt.show()
In [60]:
i=4000

plt.scatter(trajectory[0,-i:],trajectory[1,-i:], )
#plt.xlim([0, 28*3])
#plt.ylim([0,28*3])
Out[60]:
<matplotlib.collections.PathCollection at 0x112ce2ed0>
In [55]:
hoge=np.array((np.cos(1/10.),np.cos(1/10.)))
In [57]:
images[:,:,1]+hoge.T
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-57-c68216720c60> in <module>()
----> 1 images[:,:,1]+hoge.T

ValueError: operands could not be broadcast together with shapes (28,28) (2,) 
In [ ]: